<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<%
     String parentPath = request.getParameter("parentPath");
     String problemName = request.getParameter("problemName");
     String products[] = {"ESB","GReg","IS","BAM","GS","BPS","MS","DSS","WSAS","WSF"};
/*
     String ESB[] = {"2.1.3","2.1.2","2.1.1","2.1.0","2.0.2","2.0.1","2.0"};
     String GReg[] = {"3.0.3","3.0.2","3.0.1","3.0.0","2.0"};
     String IS[] = {"2.0.3","2.0.2","2.0.1","2.0.0"};
     String BAM[] ={"1.0.1"};
     String GS[] = {"1.0.1"};
     String BPS[] = {"1.1.1","1.1.0","1.0.1","1.0"};
     String MS[] = {"2.0.2","2.0.1","2.0.0","1.5.2"};
     String DSS[] = {"2.2.1","2.2.0","2.0.0","1.0.1"};
     String WSAS[] = {"3.1.3","3.1.2","3.1.1","3.0.1","3.0"};
*/
     String cP[] = {"2.0.3","2.0.2","2.0.1","2.0.0"};
     String jdkP[] = {"1.6","1.5"};
%>

<div>

    <!--form id="skbAddForm" action="../registry/custom/skb/skb_add_handler_ajaxprocessor.jsp" method="post"-->
    <!--form id="skbAddForm" action="../skb/skb_add_handler_ajaxprocessor.jsp" method="post"-->
    <form id="skbAddForm" action="skb_add_handler_ajaxprocessor.jsp" method="post">
        <input type="hidden" name="parentPath" id="parentPath" value="<%=parentPath%>"/>
        <div id="workArea">
            <table style="width: 100%; font-size: 95% " class="styledLeft" >
                <thead><tr><th colspan="2">Add a new Problem to Knowledge Base</th></tr></thead>
                <tbody>
                    <tr>
                        <td class="leftCol-med">Problem Name<span class="required">*</span></td>
                        <td><textarea  rows="3" cols="15" name="problemName" id="problemName" class="normal-textarea" style="margin-left: 2px; margin-right: 2px; width: 541px; "></textarea></td>
                    </tr>
                    <tr>
                        <td>Description</td>
                        <td><textarea  rows="4" cols="15" name="description" id="description" class="normal-textarea" style="margin-top: 2px; margin-bottom: 2px; height: 68px; margin-left: 2px; margin-right: 2px; width: 541px; "></textarea></td>
                    </tr>
                    <tr>
                        <td>Issue Link<span class="required">*</span></td>
                        <td><input type="text" name="link" style="width: 541px; "/></td>
                    </tr>
                    <tr>
                        <td>Question & Answer</td>
                        <td id="qnaTdID">
                            <div class="icon-link-ouside registryWriteOperation">
                                <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="javascript:showHideCommon('qID');if($('qID').style.display!='none')document.forms.skbAddForm.question.focus()">Add Question & Answer</a>
                            </div>
                            <div id="qID" style="display:none;">
                                <input type="hidden" name="qnArray" id="qnArray" value=""/>
                                <input type="hidden" name="ansArray" id="ansArray" value=""/>
                                <table cellpadding="1" cellspacing="1" border="1" class="styledLeft" style="width: 506px; ">
                                    <thead>
                                        <tr>
                                            <th colspan="2">Add New Question & Answer</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td valign="top">Question<span class="required">*</span></td>
                                            <td><textarea  name="question" id="question" class="normal-textarea" style="margin-top: 2px; margin-bottom: 2px; height: 53px; margin-left: 2px; margin-right: 2px; width: 424px; "></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top">Answer<span class="required">*</span></td>
                                            <td><textarea  name="answer" id="answer" class="normal-textarea" style="margin-top: 2px; margin-bottom: 2px; height: 53px; margin-left: 2px; margin-right: 2px; width: 424px; "></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="buttonRow"><input type="button" class="button" value="Add" onclick="AddQnAToArray();"><input style="margin-left:5px;" type="button" class="button" value="Cancel" onclick="javascript:showHideCommon('qID');">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>

                            </div>
                            <div id="qnaTdiv">
                                <table id="qnatID" >
                                </table>
                            </div>
                        </td>

                    </tr>
                    <tr>
                        <td>Solution</td>
                        <td id="solTdId">
                            <div class="icon-link-ouside registryWriteOperation">
                                <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="javascript:showHideCommon('sID');if($('sID').style.display!='none')document.forms.skbAddForm.solution.focus()">Add Solution</a>
                            </div>
                            <div id="sID" style="display:none;">
                                <input type="hidden" name="solArray" id="solArray" value=""/>
                                <table cellpadding="1" cellspacing="1" border="1" class="styledLeft" style="width: 506px; ">
                                    <thead>
                                        <tr>
                                            <th colspan="2">Add New Solution</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td valign="top">Solution<span class="required">*</span></td>
                                            <td><textarea  name="solution" id="solution" class="normal-textarea" style="margin-top: 2px; margin-bottom: 2px; height: 53px; margin-left: 2px; margin-right: 2px; width: 428px; "></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="buttonRow"><input type="button" class="button" value="Add" onclick="AddSolToArray();"><input style="margin-left:5px;" type="button" class="button" value="Cancel" onclick="javascript:showHideCommon('sID');">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div id="solTdiv">
                                <table id="soltID"  >
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>Related Product</td>
                        <td id="prTdId">
                            <!--div class="icon-link-ouside registryWriteOperation">
                                <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="javascript:showHideCommon('pID');">Add Product</a>
                            </div>
                            <div id="pID" style="display:none;"-->
                                <table cellpadding="0" cellspacing="0" border="0" class="styledLeft" style="width: 541px;">
                                    <tbody>
                                        <tr>
                                            <td>Product</td>
                                            <td>
                                                <select name="product" id="product" >
                                                    <%
                                                    for(int i=0; i< products.length; i++){
                                                        String name1 = products[i];
                                                    %>
                                                    <option value="<%= name1%>"><%= name1%></option>
                                                    <%
                                                }
                                                    %>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Product Release</td>
                                            <td><input type="text" name="productRelease" id="productRelease"/></td>
                                        </tr>
                                    </tbody>
                                </table>
                            <!--/div-->
                        </td>
                    </tr>
                    <tr>
                        <td>Environment</td>
                        <td id="envTdId">
                            <div class="icon-link-ouside registryWriteOperation">
                                <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="javascript:showHideCommon('eID');">Add Environment</a>
                            </div>
                            <div id="eID" style="display:none;">
                                <table cellpadding="0" cellspacing="0" border="0" class="styledLeft" style="width: 541px;">
                                    <tbody>
                                        <tr>
                                            <td>Carbon Platform</td>
                                            <td>
                                                <select name="carbonPlatform" id="carbonPlatform" >
                                                    <%
                                                    for(int i=0; i< cP.length; i++) {
                                                        String name1 = cP[i];
                                                    %>
                                                    <option value="<%= name1%>"><%= name1%></option>
                                                    <%
                                                }
                                                    %>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>JDK Platform</td>
                                            <td>
                                                <select name="jdkPlatform" id="jdkPlatform" >
                                                    <%
                                                    for(int i=0; i< jdkP.length; i++) {
                                                        String name1 = jdkP[i];
                                                    %>
                                                    <option value="<%= name1%>"><%= name1%></option>
                                                    <%
                                                }
                                                    %>
                                                </select>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>Tags<span class="required">*</span></td>
                        <td id="tagTdId">
                            <!--div class="icon-link-ouside registryWriteOperation">
                                <a class="icon-link registryWriteOperation" style="background-image:url(../admin/images/add.gif);" onclick="javascript:showHideCommon('kwID');if($('kwID').style.display!='none')document.forms.skbAddForm.question.focus()">Add Tag</a>
                            </div>
                            <div id="kwID" style="display:none;"-->
                                <table cellpadding="0" cellspacing="0" border="0" class="styledLeft" style="width: 541px; ">
                                    <tbody>
                                        <tr>
                                            <td><input type="text" name="keyWord" style="width: 523px; "/></td>
                                        </tr>
                                    </tbody>
                                    <div style="font-style:italic;margin-top:5px;">
                                        <img src="../info/images/help-small.jpg" style="margin-right:5px;">
                                        Use commas ("one, two") to add multiple tags.
                                    </div>
                                </table>
                            <!--/div-->
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="buttonRow"><input class="button" type="submit" value="Save"/></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </form>
    <br/>
</div>